package com.sy.fahai.sifa;

import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.swing.clipboard.ClipboardUtil;
import cn.hutool.core.util.StrUtil;

import java.math.BigDecimal;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

public class DataMain {


    static Map<String, String> map = new HashMap<String, String>() {
        {
            put("number(double)", BigDecimal.class.getSimpleName());
            put("integer(int32)", Integer.class.getSimpleName());
            put("number", BigDecimal.class.getSimpleName());
            put("string", String.class.getSimpleName());
            put("string(date-time)", String.class.getSimpleName());

        }
    };

    public static void main(String[] args) {


        String str = "";
        String noe = ClipboardUtil.getStr();

        List<String> split = StrUtil.splitTrim(noe, "\n");

        StringBuilder sb = new StringBuilder(noe.length() * 2);

        for (String s : split) {

            List<String> stringList = StrUtil.splitTrim(s, "\t");


            String template = StrUtil.format("/**\n*{}\n*{}\n */\n", StrUtil.nullToEmpty(CollUtil.get(stringList, 1)),
                    StrUtil.nullToEmpty(CollUtil.get(stringList, 2)));

            sb.append(template);
            sb.append("private ")
                    .append("String")
                    .append(" ")
                    .append(StrUtil.nullToEmpty(CollUtil.get(stringList, 0)))
                    .append(";")
                    .append("\n");
        }

        System.out.println(sb);

        ClipboardUtil.setStr(sb.toString());
    }

}
